; Music of Bruce Lee (1984) (U.S. Gold)
; Ripped by Megachur the 10/10/2008

; Need System Vectors

	write "BRUCELEE.BIN"

music_date_rip	equ &0aa8
music_adr	equ &8c00
first_theme	equ 0
last_theme	equ 0

	read "music_header_v1_0.asm"

	jp l8d14	; init
	jp l8dd0
	jp l8d61
	jp l8deb
	jp l8dfa
	jp l8e09
	jp l8e18
	jp l8e27
	jp l8e36
	jp l8e45
	jp l8e54
	jp l8e63
.l8c24
	db #04,#00,#0f,#04,#02,#0e,#01,#00
	db #0a,#05,#00,#00,#01,#00,#00,#00
	db #05,#00,#0f,#04,#02,#0e,#01,#00
	db #0a,#10,#01,#07,#01,#00,#00,#01
	db #05,#00,#0f,#03,#03,#0f,#01,#00
	db #0c,#24,#02,#0b,#01,#00,#00,#04
	db #05,#00,#0f,#03,#03,#0f,#01,#00
	db #0c,#52,#03,#0c,#01,#00,#00,#05
	db #05,#00,#0f,#03,#03,#0f,#01,#00
	db #0c,#71,#0a,#0f,#02,#00,#00,#05
	db #02,#89,#05,#00,#01,#00,#01,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #02,#8f,#3c,#00,#01,#00,#03,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #02,#8f,#64,#00,#01,#00,#06,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #02,#8f,#00,#03,#01,#00,#50,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #02,#00,#0f,#03,#0a,#0f,#01,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #03,#0f,#01,#01,#19,#00,#01,#05
	db #0f,#04,#00,#00,#00,#00,#00,#00
	db #02,#00,#0c,#01,#00,#0a,#01,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
.l8ce4
	db #82,#00,#05,#01,#00,#fc,#01,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #04,#01,#00,#1e,#0a,#fa,#01,#0a
	db #03,#03,#00,#00,#00,#00,#00,#00
	db #01,#06,#fa,#04,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
;
.init_music
.l8d14
;
	ld a,#01
	ld hl,l8c24
.l8d19
	push af
	call #bcbc
	pop af
	inc a
	cp #0d
	jr nz,l8d19
	ld a,#01
	ld hl,l8ce4
.l8d28
	push af
	call #bcbf
	pop af
	inc a
	cp #04
	jr c,l8d28
	ld hl,l8ed2
	ld (l8d56),hl
	ld hl,l8d58
	ld b,#09
.l8d3d
	ld (hl),#00
	inc hl
	djnz l8d3d
	ld hl,l8d4d
	ld b,#81
	ld de,l8d67
	jp #bcd7
.l8d4d
	db #00,#00,#00,#00,#00,#00,#00,#00
.l8d5b equ $ + 6
.l8d59 equ $ + 4
.l8d58 equ $ + 3
.l8d56 equ $ + 1
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00
;
.stop_music
.l8d61
;
	ld hl,l8d4d
	jp #bcdd
;
.play_music
.l8d67
;
	push af
	push bc
	push de
	push hl
.l8d6b
	ld hl,(l8d56)
	ld a,(hl)
	and #03
	jp z,l8dbd
	cp #03
	jr nz,l8d79
	inc a
.l8d79
	ld c,a
	push hl
	push bc
	call #bcad
	pop bc
	pop hl
	and #07
	jr z,l8dc3
	ld a,c
	ld (l8d58),a
	ld a,(hl)
	rra
	and #7e
	push hl
	ld l,a
	ld h,#00
	ld de,l8e72
	add hl,de
	ld e,(hl)
	inc hl
	ld d,(hl)
	ld (l8d5b),de
	pop hl
	inc hl
	ld a,(hl)
	rra
	and #38
	ld c,a
	ld a,(l8d58)
	or c
	ld (l8d58),a
	ld a,(hl)
	and #0f
	ld (l8d59),a
	inc hl
	ld (l8d56),hl
	ld hl,l8d58
	call l8dc8
	jp l8d6b
.l8dbd
	ld hl,l8d4d
	call #bcdd
.l8dc3
	pop hl
	pop de
	pop bc
	pop af
	ret
.l8dc8
	push ix
	call #bcaa
	pop ix
	ret
.l8dd0
	call #bd19
	ld a,#01
	call #bcad
	and #f8
	ret nz
	ld a,#02
	call #bcad
	and #f8
	ret nz
	ld a,#04
	call #bcad
	and #f8
	ret
.l8deb
	ld hl,l8df1
	jp l8dc8
.l8df1
	db #04,#06,#00,#00,#00,#0a,#0a,#00
	db #00
.l8dfa
	ld hl,l8e00
	jp l8dc8
.l8e00
	db #81,#07,#00,#00,#00,#1e,#00,#03
	db #00
.l8e09
	ld hl,l8e0f
	jp l8dc8
.l8e0f
	db #01,#08,#00,#00,#00,#0a,#00,#06
	db #00
.l8e18
	ld hl,l8e1e
	jp l8dc8
.l8e1e
	db #01,#09,#00,#00,#00,#01,#00,#00
	db #00
.l8e27
	ld hl,l8e2d
	jp l8dc8
.l8e2d
	db #86,#0a,#01,#46,#00,#00,#0d,#00
	db #00
.l8e36
	ld hl,l8e3c
	jp l8dc8
.l8e3c
	db #84,#0b,#02,#00,#07,#00,#00,#00
	db #00
.l8e45
	ld hl,l8e4b
	jp l8dc8
.l8e4b
	db #01,#0b,#02,#00,#06,#00,#00,#00
	db #00
.l8e54
	ld hl,l8e5a
	jp l8dc8
.l8e5a
	db #82,#0c,#00,#00,#00,#1f,#0c,#e6
	db #ff
.l8e63
	ld hl,l8e69
	jp l8dc8
.l8e69
	db #84,#00,#03,#c8,#00,#00,#0a,#18
	db #00
.l8e72
	dw #0470,#0431,#03f4,#03bc
	dw #0386,#0355,#0324,#02f6
	dw #02cc,#02a4,#027e,#025a
	dw #0238,#0218,#01fa,#01de
	dw #01c3,#01aa,#0192,#017b
	dw #0166,#0152,#013f,#012d
	dw #011c,#010c,#00fd,#00ef
	dw #00e1,#00d5,#00c9,#00be
	dw #00b3,#00a9,#009f,#0096
	dw #008e,#0086,#007f,#0077
	dw #0071,#006a,#0064,#005f
	dw #0059,#0054,#0050,#004b
.l8ed2
	db #0a,#02,#3a,#02,#26,#02,#2a,#02
	db #0a,#02,#3a,#02,#26,#02,#2a,#02
	db #69,#22,#0a,#12,#61,#02,#3a,#02
	db #69,#05,#26,#02,#2a,#02,#0a,#02
	db #3a,#02,#26,#02,#2a,#02,#69,#22
	db #0a,#12,#61,#02,#3a,#02,#69,#05
	db #26,#02,#2a,#02,#0a,#02,#3a,#02
	db #26,#02,#2a,#02,#1e,#12,#7d,#21
	db #7d,#01,#4e,#02,#7d,#01,#7d,#01
	db #1e,#02,#75,#02,#7d,#02,#4e,#02
	db #1e,#12,#7d,#21,#7d,#01,#4e,#02
	db #7d,#01,#7d,#01,#1e,#02,#75,#02
	db #7d,#02,#4e,#02,#69,#22,#0a,#12
	db #61,#02,#3a,#02,#69,#05,#26,#02
	db #2a,#02,#0a,#02,#3a,#02,#26,#02
	db #2a,#02,#69,#22,#0a,#12,#61,#02
	db #3a,#02,#69,#05,#26,#02,#2a,#02
	db #0a,#02,#3a,#02,#26,#02,#2a,#02
	db #1e,#12,#7d,#21,#7d,#01,#4e,#02
	db #7d,#01,#7d,#01,#1e,#02,#75,#02
	db #7d,#02,#4e,#02,#1e,#12,#7d,#21
	db #7d,#01,#4e,#02,#7d,#01,#7d,#01
	db #1e,#02,#75,#02,#7d,#02,#4e,#02
	db #55,#21,#42,#11,#55,#01,#42,#01
	db #55,#01,#42,#01,#55,#01,#42,#01
	db #4d,#22,#3a,#12,#55,#02,#42,#02
	db #71,#21,#56,#11,#71,#01,#56,#01
	db #71,#01,#56,#01,#71,#01,#56,#01
	db #69,#02,#4e,#02,#71,#02,#56,#02
	db #85,#21,#42,#11,#85,#01,#42,#01
	db #85,#01,#42,#01,#85,#01,#42,#01
	db #7d,#02,#6a,#02,#85,#02,#42,#02
	db #b5,#01,#a1,#01,#85,#01,#71,#01
	db #55,#01,#41,#01,#55,#01,#71,#01
	db #85,#25,#72,#15,#00,#00
;
.game_name
	db "Bruce Lee",0
.game_year
	db "1984",0
.game_publisher
	db "U.S. Gold",0
.music_author
	db "",0
.music_comment
	db "",0

	read "music_end_v1_0.asm"
